@ECHO OFF
rem CONFIG START
rem -------------------------------------------------------------------------------
set RAR="%PROGRAMFILES%\winRar\rar.exe"

set BZIP="Docs and stuff\rars\bzip2-1.0.4.rar"
set LUA="Docs and stuff\rars\lua-5.0.2.rar"
set LUASQL="Docs and stuff\rars\luasql.rar"
set PCRE="Docs and stuff\rars\pcre-6.4.rar"
set RES="Docs and stuff\rars\res.rar"
set ZLIB="Docs and stuff\rars\zlib-1.2.3.rar"
set STLPORT="Docs and stuff\rars\stlport-5.1.4.rar"
set WTL="Docs and stuff\rars\DCDMPlusPlus-wtl8-src.rar"
set PYTHON="rars\python.rar"
set INCLUDES="..\Docs and stuff\rars\for binary.rar"
set RARPARAMS=x -r -idp -inul 

rem CONFIG END
rem -------------------------------------------------------------------------------
IF NOT EXIST "%PROGRAMFILES%\WinRAR\Rar.exe" (
	echo "Winrar could not be found."
	pause
	goto:eof
)

ECHO ---------------------------
ECHO Make sure the path is clear
cd..
cd..
rd /s /q bzip2 > nul
rd /s /q lua-5.0.2 > nul
rd /s /q luasql > nul
rd /s /q pcre > nul
rd /s /q res > nul
rd /s /q zlib > nul
rd /s /q stlport > nul
rd /s /q wtl > nul
rd /s /q "Docs and stuff\python" > nul
rd /s /q "Docs and stuff\misc" > nul
md "Docs and stuff\misc" > nul

ECHO ---------------------------
ECHO Getting includes
IF NOT EXIST app (
md app > nul
cd app > nul
%RAR% %RARPARAMS% %INCLUDES%
cd..
)
%RAR% %RARPARAMS% %BZIP%
%RAR% %RARPARAMS% %LUA%
%RAR% %RARPARAMS% %LUASQL%
%RAR% %RARPARAMS% %PCRE%
%RAR% %RARPARAMS% %RES%
%RAR% %RARPARAMS% %ZLIB%
%RAR% %RARPARAMS% %STLPORT%
%RAR% %RARPARAMS% %WTL%
cd "Docs and stuff"
%RAR% %RARPARAMS% %PYTHON%

ECHO ---------------------------
ECHO finished!
pause